![]() |
FindScriptRun |
||||
Header: | TextUtils.h | Carbon status: | Supported | |
Finds the next block of subscript text within a script run.
ScriptRunStatus FindScriptRun ( Ptr textPtr, SInt32 textLen, SInt32 *lenUsed );
A pointer to the text string to be analyzed.
The number of bytes in the text string.
On output, a pointer to the length, in bytes, of the script run that begins with the first character in the string; this length is always greater than or equal to 1, unless the string passed in is of length 0.
Identifies the run as either native text, Roman, or one of the defined subscripts of the script system and returns a structure of type ScriptRunStatus.
The FindScriptRun function is used to identify blocks of subscript text in a string, taking into account script and language considerations, making use of tables in the string-manipulation ('itl2') resource in its computations. Some script systems include subscripts, which are character sets that are subsidiary to the main character set. One useful subscript is the set of all character codes that have the same meaning in Roman as they do in a non-Roman script. For other scripts such as Japanese, there are additional useful subscripts. For example, a Japanese script system might include some Hiragana characters that are useful for input methods.
FindScriptRun computes the length of the current run of subscript text in the text string specified by textPtr and textLen. It assigns the length, in bytes, to the lenUsed parameter and returns a status code. You can advance the text pointer by the value of lenUsed to make subsequent calls to this function. You can use this function to identify runs of subscript characters so that you can treat them separately.
Word processors and other applications can call FindScriptRun to separate style runs of native text from non-native text. You can use this capability to extract those characters and apply a different font to them.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)